﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;
using Fan.Dongping.Ali.Common.Bean;
using Fan.Dongping.Ali.BusinessRules;


namespace WCFService
{
    // NOTE: If you change the class name "NoteService" here, you must also update the reference to "NoteService" in Web.config.
    public class NoteService : INoteService
    {

        #region INoteService Members

        public string[] GetNoteCategory(string userId)
        {
            throw new NotImplementedException();
        }

        public NoteSummary[] GetAllNotesByUser(string userID)
        {
            List<NoteSummary> nss = NoteBiz.Instance.GetUserNotes(userID);
            NoteSummary[] nsl = nss.ToArray();
            return nsl;

            //if (nsl == null || nsl.Length == 0)
            //{
            //    NoteSummary note = new NoteSummary();
            //    note.NoteId = 123;
            //    note.Summary = "summmmmary";
            //    note.Topic = userID;

            //    nsl = new NoteSummary[1];
            //    nss[0] = note;
            //    return nsl;

            //}
            //else
            //{
            //    return nsl;
            //}
        }

        public bool UpdateNote(string userId, long noteId, string topic, string body)
        {
            throw new NotImplementedException();
        }

        public long InsertNotes(string userID, string topic, string body)
        {
            throw new NotImplementedException();
        }


        public NoteSummary GetNote(long noteId)
        {
            NoteSummary note = new NoteSummary();
            note.NoteId = noteId;
            note.Summary = "summmmmary";
            note.Topic = "topiiiiic";
            return note;
        }

        #endregion
    }
}
